package com.aw.baselib.util.download;


import com.aw.baselib.base.AwBaseApplication;

import java.io.File;
import java.io.Serializable;

public class DownloadResBean implements Serializable {

    private String url;
    private String totalSize;
    private String currentSize;
    private boolean isCompleted;
    private String path;
    private String fileName;

    public String getPath() {
        File file = new File(AwBaseApplication.getInstance().getExternalCacheDir() + File.separator + "downloadRes");
        if(!file.exists())
            file.mkdirs();
        File downloadResFile = null;
        try {
            downloadResFile = new File(file, fileName);
        } catch (Exception e) {
            e.printStackTrace();
            downloadResFile = file;
        }
        this.path = downloadResFile.getAbsolutePath();
        return path;
    }


    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getTotalSize() {
        return totalSize;
    }

    public void setTotalSize(String totalSize) {
        this.totalSize = totalSize;
    }

    public String getCurrentSize() {
        return currentSize;
    }

    public void setCurrentSize(String currentSize) {
        this.currentSize = currentSize;
    }

    public boolean isCompleted() {
        return isCompleted;
    }

    public void setCompleted(boolean completed) {
        isCompleted = completed;
    }
}
